#ifndef PHYMODELER_H
#define PHYMODELER_H

#include "btBulletDynamicsCommon.h"
#include "PHYCollisionObjects.h"
#include <list>
using namespace std;

class PHYModeler
{
public:
	~PHYModeler();
	static PHYModeler *getInstance();
	void AddCollisionObject(PHYCollisionObj *ipObj);
	PHYCollisionObj* GetCollisionObject(int iIndex);
	int GetNbCollisionObjects();
	void UpdateLocations();
	void BeginSimulation();
private:
	void _CreateCollisionBody(PHYCollisionObj *ipObj);
	PHYModeler();
	void _CreateGround();
	list<PHYCollisionObj*> _CollisionObjects;
	btAlignedObjectArray<btRigidBody*> _CollisionBodies;
	static PHYModeler *pModeler;
	btDiscreteDynamicsWorld* _dynamicsWorld;
};

#endif
